/**
 * @author: HenryDai
 * @Date: 2022/04/29 13:26
 * @description:
 */
public class HavingMoneyState implements State{

    @Override
    public void insertCoins(VendingMachine machine) {
        System.out.println("操作错误: 有钱的状态下, 不许允许二次投币");
    }

    @Override
    public void backCoins(VendingMachine machine) {
        System.out.println("操作正确: 有钱的状态下, 退钱成功");
        machine.setState(new NoMoneyState());
    }

    @Override
    public void pressButton(VendingMachine machine) {
        System.out.println("操作正确: 有钱的状态下, 选物按键成功");
        machine.setState(new SoldState());
    }

    @Override
    public void distributeGood(VendingMachine machine) {
        System.out.println("操作错误: 有钱的状态下, 不许允许直接发放商品,请先按下按键");
    }

}
